import 'package:cook_dinner/application.dart';
import 'package:flutter/material.dart';
import 'package:cook_dinner/config/include.dart';

class SplashScreen extends StatefulWidget {
  const SplashScreen({Key? key}) : super(key: key);

  @override
  State<SplashScreen> createState() => _SplashScreenState();
}

class _SplashScreenState extends State<SplashScreen> {
  @override
  void initState() {
    super.initState();
    Future.delayed(const Duration(seconds: 3), () {
      Navigator.pushReplacement(
        context,
        MaterialPageRoute(builder: (context) => const AppLocation()),
      );
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      extendBody: true,
      body: Image.asset(
        'assets/images/startup_page.jpg',
        width: HYSizeFit.screenWidth,
        height: HYSizeFit.screenHeight + HYSizeFit.statusHeight,
        fit: BoxFit.fill,
      ),
    );
  }
}
